#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin >> n;
	long long f[n+1] = {0};
	f[1] = 3, f[2] = 7, f[3] = 17;
	for(int i = 4; i <= n; i++)
		f[i] = 2 * f[i-1] + f[i-2];
	cout << f[n] << endl;
	return 0;
}